{extend name="public/base" /}
{block name="pjax_container"}
<?php
    $titleTypeName = '编辑';
?>
<style>
tr>th,td{
    text-align: center;
}

.content-header>.breadcrumb>li{
    color: #999;
}
.content-header>.breadcrumb>.active{
    color: #666;
}
.content-header{
    height: 51px;
 
}
.btn-primary{
      background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 5px 10px; 
}
.box-primary{
  border-top-color: #ecf0f5 !important;
  border-top-width: 16px;
  
}
.btn-primary:hover{
     background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .9;
    border-radius: 6px !important; 
}
.delete-one{
    background-color: ff4141 !important;
    margin-left: 15px;
    border-radius: 6px;
}
.sreachs{
       background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
.input-group{
    display: flex;
    flex-wrap: wrap;
} 
.sreachs:hover{
       background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .8;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
.form-group>label{
height: 100%;
line-height: 30px;
margin-left: 10px;
}
.form-group>input{
    border: none;
    height: 100%;
    border-bottom: 1px solid #ccc;
}
.nav-tabs-custom{
    margin-top: 16px;
}

</style>
<section class="content-header">
    <h1>{$titleTypeName}</h1>
    <ol class="breadcrumb">
        <li>企业管理</li>
        <li>企业列表</li>
        <li class="active">{$titleTypeName}</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" action="/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}" onsubmit="return false" >
                <input type="hidden" name="id" value="{$info.id|default=0}" />
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业logo(选填)</label>
                                <div class="col-sm-7">
                                    <div class="input-group">
                                        <input class="form-control" name="logo" value="{$info['logo']|default=''}" placeholder="" >
                                        <span class="input-group-btn">
                                        <a href="{$info['logo']|default='/static/global/face/no-image.png'}" target="_blank" >
                                            <img src="{$info['logo']|default='/static/global/face/no-image.png'}" style="height:34px; width:68px;" />
                                        </a>
                                        <button class="btn btn-success btn-flat up-btn" type="button" data-url="{:url('File/store')}">
                                            <i class="fa fa-cloud-upload"> 上传</i>
                                        </button>
                                    </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">月度人均积分</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="" value="{$info['average_integral']|default=''}" readonly="readonly" placeholder="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">月度平均奖扣人次</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="" value="{$info['average_sum']|default=''}" readonly="readonly" placeholder="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业名称</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="name" value="{$info['name']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业简称</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="name_short" value="{$info['name_short']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业账号</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="account" value="{$info['account']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业代码</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="account_code" value="{$info['account_code']|default=''}" placeholder="企业代码必须为数字加字母组合">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">所属行业(选填)</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="trade_id" style="width:100%;">
                                        <option value="0">选择行业</option>
                                        {foreach name="$trade_list" item="vo" key="ko"}
                                            {if condition="$vo['status'] == 1"}
                                            <option value="{$ko}" <?php if(isset($info['trade_id']) && $info['trade_id']==$ko){echo "selected";}?>>{$vo['name']}</option>
                                            {/if}
                                        {/foreach}
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">经营类型(选填)</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="manage_id" style="width:100%;">
                                        <option value="0">选择行业</option>
                                        {foreach name="$manage_list" item="vo" key="ko"}
                                            {if condition="$vo['status'] == 1"}
                                            <option value="{$ko}" <?php if(isset($info['manage_id']) && $info['manage_id']==$ko){echo "selected";}?>>{$vo['name']}</option>
                                            {/if}
                                        {/foreach}
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">企业负责人</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="principal" value="{$info['principal']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">负责人电话</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="mobile" value="{$info['mobile']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">负责人性别</label>
                                <div class="col-sm-7">
                                    <label class="checkbox-inline"><input type="radio" name="sex" value="1" {if condition="!isset($info['sex']) || $info['sex']==1"}checked{/if} class="minimal"> 男</label>
                                    <label class="checkbox-inline"><input type="radio" name="sex" value="2" {if condition="isset($info['sex']) && $info['sex']==2"}checked{/if} class="minimal"> 女</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">职务</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="duty" value="{$info['duty']|default=''}" placeholder="">
                                </div>
                            </div>

                            <!--<div class="form-group">-->
                                <!--<label class="col-sm-2 control-label">移动电话</label>-->
                                <!--<div class="col-sm-7">-->
                                    <!--<input class="form-control" name="mobile" value="{$info['mobile']|default=''}" placeholder="">-->
                                <!--</div>-->
                            <!--</div>-->

                            <div class="form-group">
                                <label class="col-sm-2 control-label">成立时间(选填)</label>
                                <div class="col-sm-7">
                                    <input class="form-control timepicker" name="set_time" value="{$info['set_time']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">所在地区</label>
                                <div class="col-sm-7">
                                    {include file="form/input_addr"}
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">地址</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="address" value="{$info['address']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">电子邮箱(选填)</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="email" value="{$info['email']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">邮编(选填)</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="code" value="{$info['code']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">网址(选填)</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="url" value="{$info['url']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">对接人</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="docking_people" value="{$info['docking_people']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">对接人电话</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="docking_mobile" value="{$info['docking_mobile']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">对接人性别</label>
                                <div class="col-sm-7">
                                    <label class="checkbox-inline"><input type="radio" name="docking_sex" value="1" {if condition="!isset($info['docking_sex']) || $info['docking_sex']==1"}checked{/if} class="minimal"> 男</label>
                                    <label class="checkbox-inline"><input type="radio" name="docking_sex" value="2" {if condition="isset($info['docking_sex']) && $info['docking_sex']==2"}checked{/if} class="minimal"> 女</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">启动日期</label>
                                <div class="col-sm-7">
                                    <input class="form-control timepicker" name="start_time" value="{$info['start_time']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">到期时间</label>
                                <div class="col-sm-7">
                                    <input class="form-control timepicker" name="use_time" value="{$info['use_time']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">使用用户量 人</label>
                                <div class="col-sm-7">
                                    <input class="form-control" type="number" name="use_people" value="{$info['use_people']|default=''}" placeholder="">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">状态</label>
                                <div class="col-sm-7">
                                    <label class="checkbox-inline"><input type="radio" name="status" value="1" {if condition="!isset($info['status']) || $info['status']==1"}checked{/if} class="minimal"> 开启</label>
                                    <label class="checkbox-inline"><input type="radio" name="status" value="0" {if condition="isset($info['status']) && $info['status']==0"}checked{/if} class="minimal"> 关闭</label>
                                </div>
                            </div>

                        </div>
                    </div>

                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; 提交">提交</button>
                            </div>
                        </div>
                    </div>

                </div>
            </form>
        </div>
    </div>
</section>
<script type="application/javascript">
    $(document).ready(function () {
        /*ajax页面加载icheck，有该控件的页面才需要*/
        $(".select2").select2({language:"zh-CN"});

        $('.timepicker').datetimepicker({
            format: "{$timepickerFormat | default='YYYY-MM-DD'}",   //YYYY-MM-DD HH:mm:ss
            locale: moment.locale('zh-cn')
        });
    })
</script>
{/block}
